The use of simulation systems for developing computer systems and software has shown to provide tremendous advantages in terms of time savings and cost. More recently, the technique of full system simulation has gained more attention as advances in processor speeds of contemporary host computer platforms enable good simulation of detailed hardware models in computer system architectures. System simulation provides a virtual computer with the capability to create functional models of CPUs with supporting chips in sufficient detail to execute native object code without modification. Furthermore, simulation provides the significant advantage of enabling developers to develop and test their software applications and hardware products on high-end systems without having to use actual hardware with its associated expense or unavailable hardware still under development.
Simulation offers benefits for software development where it can arbitrarily parameterize, control, and inspect the computer system it is modeling and provide measurements that are non-intrusive and deterministic. It also provides a basis for automation where multiple simulator sessions can run in parallel and sessions can be fully scripted using performance monitors. For example, the software can be combined with the virtual systems in a way that facilitates modeling of the processor, disk access, memory access, cache configuration, and memory system bus and other parameters. With full system simulation, the operating system, device drivers, and application software cannot tell whether they are running on real hardware or in the simulated environment. Maximum flexibility is obtained using the simulated environment with the ability to change the parameters to suit a particular testing environment while performing comprehensive data collection and execution and performance tracking.
An important issue relating to simulation systems is that of performance i.e. a tradeoff must typically be made between the accuracy of simulating the system as closely as possible versus a performance level that is acceptable. Creating a more realistic simulation workload environment generally comes at the expense of time and cost to deal with specification inaccuracies and implementation errors. One area that has a significant affect on performance relates to the execution of code fragments that, for example, typically occur frequently in operating systems. These code fragments usually consist of loops that are run when a processor waits for something to occur. Often, when these loops are executed they perform very little, if any, computation at all. Therefore, it would seem desirable to improve simulation performance by skipping the execution of these code loops to arrive at the end of the loop directly. However, this is not always trivial because an important objective is to simulate as closely as possible all execution steps of the real hardware environment. Hence, eliminating the execution of some code fragment loops may lead to a result that may not correspond accurately to what is run on real hardware. It therefore is important to be able to maintain equivalence between the number of instructions executed in the simulated environment versus the instructions run on the real hardware, and maintaining a fixed ratio with respect to the amount of virtual time that has elapsed versus real time on the hardware.
In view of the foregoing, it is desirable to improve simulation performance by optimizing the execution of instructions in an instruction set simulator (ISS) in a manner that is efficient and non-intrusive, i.e. produces the same simulated result and consumes the same amount of virtual time as compared to running an unmodified simulator.